﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SimpleBinding {
    public partial class Form1 : Form {
        NwindDataSet ds = new NwindDataSet();
       
        public Form1() {
            InitializeComponent();
            NwindDataSetTableAdapters.CustomersTableAdapter ta = new NwindDataSetTableAdapters.CustomersTableAdapter();
            ta.Fill(ds.Customers);
            BindingSource BS = new BindingSource(ds, "Customers");
            textBox1.DataBindings.Add("Text", BS, "CompanyName");
        
        }

        private void Form1_Load(object sender, EventArgs e) {
     
       
        }

        private void textBox1_Validating(object sender, CancelEventArgs e) {
            if (textBox1.Text.ToString().Length == 0) {
                errorProvider1.SetError(textBox1, "Este Campo No Puede ser vacio!!!");
            }
        }

     

    }
}
